#ifndef MENU_H
#define MENU_H

extern "C"
{
#include "OLED.h"
}

#define GRAPH_COLOR	(unsigned char)0x27

#define GRAPH_START	(unsigned int)45
#define GRAPH_END	(unsigned int)115
#define GRAPH_RIGHT	(unsigned int)127
#define GRAPH_LEFT	(unsigned int)0
#define TIME_HEIGHT	(unsigned int)120
#define TEXT_OFFSET	(unsigned int)5
#define TEXT_SPACING	(unsigned int)4
#define VAL_OFFSET	(unsigned int)90
#define TEXT_HEIGHT	(unsigned int)45


#define MAX_VARIABLES		10
#define NUM_MEASUREMENTS	4

#define RST_INDEX		4
#define PONG_INDEX		5
#define GRAPH_INDEX		6
#define LOG_INDEX		7
#define CLOCK_INDEX		8
#define PWR_INDEX		9


#define DAY_SIZE		(unsigned char)24
#define WEEK_SIZE		(unsigned char)42
#define MONTH_SIZE		(unsigned char)32
#define YEAR_SIZE		(unsigned char)52


#define DOWN                    0
#define UP			1


class Menu
{
private:
        int var_selection,
            time_selection,
            num_vars,
            num_times; 

        class Item
        {
        private:
            char* text;
            int*  value;
            int   row;
            Item* previous;
            Item* next;
        public:
        };

        typedef Item cItem_t,*cpItem_t;
        cpItem_t selection;
public:        
        Menu();
        Menu(int var_selection, int time_selection);
        ~Menu();
};

typedef Menu cMenu_t, *cpMenu_t;

void InitMenu(void);
void MenuAction(unsigned char _source);
void GraphAction(void);
void UpdateGraph(void);

#endif
